//
//  String+Extension.swift
//  EmoticonKeyBoard
//
//  Created by Arvin on 15/11/21.
//  Copyright © 2015年 Arvin. All rights reserved.
//

import Foundation

extension String {
    // 分类只能定义计算性属性, 只读
    // 将16进制emoji转成uinicode
    var emojiString: String? {
        let scanner = NSScanner(string: self)
        var value: UInt32 = 0
        scanner.scanHexInt(&value)
        let char = Character(UnicodeScalar(value))
        return "\(char)"
    }
    
}